package com.ruoyi.bzjgl.controller;

import com.ruoyi.bzjgl.domain.Bzjtable;
import com.ruoyi.bzjgl.service.BankingService;
import com.ruoyi.bzjgl.service.IBzjtableService;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 银行业务模块---朱厚福
 */
@RestController
@RequestMapping("/Banking")
public class BankingController extends BaseController {
    @Autowired
    private BankingService bankingService;

    @Autowired
    private IBzjtableService bzjtableService;

    /**
     * 查询未缴纳保证金人员列表
     * @param
     * @return
     * @throws
     */
    @GetMapping("/UnpaidList")
    public TableDataInfo UnpaidList(Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        List<Bzjtable> list=bankingService.UnpaidList(bzjtable);
        return getDataTable(list);
    }

    /**
     * 保证金收款
     * @param bzjtable
     * sqfs 收取方式,sqzt 收取状态,ajbh 案件编号,ajmc 案件名称,hsr 被取保候审人,xjr 被行政拘留人
     * sqje 收取金额, sqrq 收取日期,sqtfr 填报人(操作员),xh 序号
     * @return
     */
    @PostMapping("/collection")
    public TableDataInfo collection(@RequestBody Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        TableDataInfo tableDataInfo=bankingService.collection(bzjtable);
        return tableDataInfo;
    }

    /**
     * 查询保证金划拨列表
     */

    @GetMapping("/Transfer")
    public TableDataInfo Transfer(Bzjtable bzjtable)
    {
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        List<Bzjtable> list= bankingService.Transfer(bzjtable);
        return getDataTable(list);
    }
    /**
     * 保证金划拨
     */
    @PostMapping("/updateTransfer")
    public TableDataInfo updateTransfer(@RequestBody Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        TableDataInfo tableDataInfo=bankingService.updateTransfer(bzjtable);
        return tableDataInfo;
    }
    /**
     * 查询没收执行列表
     */
    @GetMapping("/bankSeizurelist")
    public TableDataInfo bankSeizurelist(Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        List<Bzjtable> list =bankingService.bankSeizurelist(bzjtable);
        return getDataTable(list);
    }
    /**
     * 银行没收执行
     */
    @PostMapping("/bankSeizure")
    public TableDataInfo bankSeizure(@RequestBody Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        TableDataInfo tableDataInfo =bankingService.bankSeizure(bzjtable);
        return tableDataInfo;
    }

    /**
     * 银行退还列表
     */
    @GetMapping("/bankRefundlist")
    public TableDataInfo bankRefundlist(Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        List<Bzjtable> list=bankingService.bankRefundlist(bzjtable);
        return getDataTable(list);
    }

    /**
     * 银行退还执行
     */
    @PostMapping("/bankRefund")
    public TableDataInfo bankRefund(@RequestBody Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        TableDataInfo tableDataInfo =bankingService.bankRefund(bzjtable);
        return tableDataInfo;
    }
}
